//
//  IMApp.h
//  IMSecurity
//
//  Created by infosec2013 on 2017/3/27.
//  Copyright © 2017年 IF. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "IMUser.h"
#import "IMAuthInfo.h"
#define IM_APP_TYPE_APPSTORE

#define iOS_type @"1"
#define Android_type @"2"

@interface IMApp : NSObject
@property(nonatomic,copy)NSString *appCode;
@property(nonatomic,copy)NSString *appDesc;
@property(nonatomic,copy)NSString *appDetail;
@property(nonatomic,copy)NSString *appName;
@property(nonatomic,copy)NSString *appType;
@property(nonatomic,copy)NSString *appPack;
@property(nonatomic,copy)NSString *isShow;
@property(nonatomic,copy)NSString *isApp;
@property(nonatomic,copy)NSString *appUrl;
@property(nonatomic,copy)NSString *appVersion;
@property(nonatomic,copy)NSString *updateForce;
@property(nonatomic,copy)NSString *iconUrl;
@property(nonatomic,copy)NSString *fileSize;
@property(nonatomic,copy)NSString *id;
@property(nonatomic,copy)NSString *modifyTime;
@property(nonatomic,copy)NSString *uploadTime;
@property(nonatomic,copy)NSString *picUrl;

+ (void)getAppsFromServiceWithStart:(NSInteger)startIndex
                           andCount:(NSInteger)count
                 andCompletionBlock:(void(^)(int resultCode,int totalNum,NSArray *appsInfo))completionBlock;

+ (void)downloadAppWithId:(NSString *)appId
      andCompletionBlock:(void(^)(int resultCode,NSString *downloadUrl))completionBlock;

+ (void)getConfirmAppsInfoWithAppIds:(NSString *)appIds
                  andCompletionBlock:(void(^)(int resultCode, int totalNum,NSArray *appsInfo))completionBlock;

+ (void)getAuthInfoWithUserType:(UserType)userType
                       userName:(NSString *)userName
            withCompletionBlock:(void(^)(int resultCode, IMAuthInfo *authInfo))completionBlock;

/**
 本地已安装app与所有App列表进行比对，返回已安装的列表
 */
+ (NSArray *)detectApps:(NSArray *)apps;

- (BOOL)hasInstalled;

+ (NSArray *)getAppsInfo;

@end
